import request from '@/utils/request'

// 企业列表
export function enterpriseList (params) {
  return request({
    url: '/park/enterprise',
    params
  })
}

// 获取所属行业
export function getIndustry (params) {
  return request({
    url: '/park/industry',
    params
  })
}

// 增加企业
export function addEnterprise (data) {
  return request({
    url: '/park/enterprise',
    method: 'POST',
    data
  })
}

// 查看企业详情
export function enterpriseDetail (id) {
  return request({
    url: `/park/enterprise/${id}`
  })
}

// 编辑企业
export function editEnterprise (data) {
  return request({
    url: '/park/enterprise',
    method: 'PUT',
    data
  })
}

// 删除企业
export function deleteEnterprise (id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'DELETE'
  })
}

// 查询可租赁楼宇
export function getRentBuilding () {
  return request({
    url: '/park/rent/building'
  })
}

// 添加合同
export function addRent (data) {
  return request({
    url: '/park/enterprise/rent',
    method: 'POST',
    data
  })
}

// 企业租赁信息列表
export function getExpandRent (id) {
  return request({
    url: `/park/enterprise/rent/${id}`
  })
}

// 退租
export function rentOut (id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'PUT'
  })
}
// 退租
export function deleteOut (id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'DELETE'
  })
}